package com.xinlang.util;

import org.apache.hadoop.conf.Configuration;

public class HadoopUtil {

	public static enum RUN_MODE {
		LOCAL, CLUSTER
	}

	/**
	 * @param mode
	 * @return
	 */
	public static Configuration getConf(RUN_MODE mode) {
		Configuration conf = new Configuration();
		if (mode == RUN_MODE.LOCAL) {
			conf.set("fs.defaultFS", "file:///");
			conf.set("mapred.job.tracker", "local");
			conf.set("mapreduce.framework.name", "local");
		}
		return conf;
	}

}
